package com.shitou.util;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class ReflectionUtil {

	
	@SuppressWarnings("unchecked")
	public static Class getSuperClassGenricType(Class<?> clazz) {
		
		Type genType = clazz.getGenericSuperclass();
		
		if(genType instanceof ParameterizedType) {
			Type[] params = ((ParameterizedType)genType).getActualTypeArguments();
			return (Class) params[0];
		}
		
		return Object.class;
	}
}
